﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Web;
using HexagonWeb.IDAL;

namespace HexagonWeb.DAL
{
    public class ContextFactory
    {
        //获取当前数据上下文
        public static WebDbContext GetCurrentContext()
        {
            WebDbContext _nContext = CallContext.GetData("WebDbContext") as WebDbContext;
            if(_nContext == null)
            {
                _nContext = new WebDbContext();
                CallContext.SetData("WebDbContext", _nContext);
            }
            return _nContext;
        }
    }
}